package stockblaster.client.objectives;

import stockblaster.client.CurrentUser;

public class TimeObjective extends Objective {

	/**
	 * Creates an objective with a given description and time to reach.
	 * 
	 * @param description
	 *            The English description of the objective.
	 * @param month
	 *            The month to reach.
	 * @param year
	 *            The year to reach.
	 */
	public TimeObjective(String description, int sensitivity, int month, int year) {
		super(description, sensitivity);
		this.month = month;
		this.year = year;
	}

	/**
	 * Check whether the player is at the target time.
	 * 
	 * @return Whether or not the player is at the target time.
	 */
	public boolean check() {
		return (CurrentUser.getMonth() >= month)
				&& (CurrentUser.getYear() >= year);
	}

	/**
	 * Sets the target time for the objective.
	 * 
	 * @param month
	 *            The month to reach.
	 * @param year
	 *            The year to reach.
	 */
	public void setTime(int month, int year) {
		this.month = month;
		this.year = year;
	}

	private int month;
	private int year;
}
